import settings
from django.conf.urls.defaults import *
from django.contrib import admin
from django.views.generic.simple import redirect_to

admin.autodiscover()

urlpatterns = patterns('',
    # Redirect the base URL to the Admin site for now
    (r'^$', redirect_to, {'url': '/admin/'}),

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
    (r'^accounts/login/$', 'django.contrib.auth.views.login'),
    (r'^accounts/logout/$', 'django.contrib.auth.views.logout'),

    # Module urls
    (r'device/', include ('nopbx.device.urls')),

    # Static Content
    (r'^css/images/(?P<path>.*)$',   'django.views.static.serve', {'document_root':  settings.MEDIA_ROOT + '/images/'}),
    (r'^css/(?P<path>.*)$',   'django.views.static.serve', {'document_root':  settings.MEDIA_ROOT + '/css/'}),
    (r'^images/(?P<path>.*)$', 'django.views.static.serve', {'document_root':  settings.MEDIA_ROOT + '/images/'}),
    (r'^js/(?P<path>.*)$',    'django.views.static.serve', {'document_root':  settings.MEDIA_ROOT + '/js/'}),
)
